package com.hqyj.user.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hqyj.user.dto.UserInfo;
import com.hqyj.user.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hqyj.user.pojo.UserRole;
import com.hqyj.user.pojo.MyNode;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author sdx2009
 * @since 2022-09-30
 */
public interface UserMapper extends BaseMapper<User> {
    List<MyNode> queryByName(String userName);

    Page<UserRole> queryUserRole(Page<UserRole> page, UserInfo userInfo);

    List<UserRole> selectUser();

    int updateRoleById(@Param("roleName") String roleName,@Param("userId") Integer userId);

    int deleteUserRoleByUserId(Integer userId);

    int addUserRole(@Param("userId") Integer userId,@Param("roleId") Integer roleId);
}
